(function () {

    // Views
    App.Views.Person = Backbone.View.extend({
        tagName: 'li',

        template: _.template('<%= name%> (<%= age%>) - <%= job%>'),

        render: function () {
            var tpl = this.template(this.model.toJSON());
            this.$el.html(tpl);

            return this;
        }
    });

    App.Views.People = Backbone.View.extend({
        tagName: 'ul',

        render: function () {
            this.collection.each(function (person) {
                var personView = new App.Views.Person({model: person});
                this.$el.append(personView.render().el);
            }, this);

            return this;
        }
    });


})();
